package com.graduate.daydayup.room

import androidx.room.*

@Dao
interface AccountDao {
    //如果是查询
    @Query("SELECT * FROM  Account ")
    fun getAll(): MutableList<Account>?

    @Query("SELECT * FROM  Account Where account = :ac AND pass=:ps ")
    fun getAllByAccountPass( ac:String?,ps:String): Account

    @Query("SELECT * FROM  Account Where account = :ac  ")
    fun getAllByAccount( ac:String?): Account

    @Query("DELETE FROM Account ")
    fun deleteAllBy()

    @Query("DELETE FROM Account WHERE id= :id")
    fun deleteAllById( id:String?)

    @Insert
    fun addAccount(ac:Account)

    @Update
    fun updateAccount(ac :Account)
}